//
//  CViewController.swift
//  HSMediator
//
//  Created by fan on 2021/10/18.
//

import UIKit

public class CViewController: UIViewController {
    
    var testTitle: String?
    
    var callBack: ((String)->(Void))?

    public override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        view.backgroundColor = UIColor.purple
        
        let btn = UIButton.init(type: .custom)
        btn.setTitle("回调", for: .normal)
        btn.frame = CGRect(x: 20, y: 120, width: view.frame.width - 40, height: 40)
        view.addSubview(btn)
        
        btn.addTarget(self, action: #selector(clickBtn), for: .touchUpInside)
    }
    
    @objc func test() {
        print("%@",self)
    }
    
    @objc func clickBtn() {
        guard let callBack = callBack else {
            return
        }
        callBack("Swift call back")
    }

}
